/*
 * Copyright (C) 2004-2007  Autodesk, Inc.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of version 2.1 of the GNU Lesser
 * General Public License as published by the Free Software Foundation.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */
#ifndef FDOWCSRASTERDEFINITION_H
#define FDOWCSRASTERDEFINITION_H

#ifdef _WIN32
#pragma once
#endif //_WIN32

#include <WCS/FdoWcsOvProvider.h>
#include <WCS/Override/FdoWcsOvCoverageCollection.h>

/// \brief
///  
/// The FdoWcsOvRasterDefinition class defines the physical overrides for a raster property in a WCS FDO schema.
class FdoWcsOvRasterDefinition : public FdoPhysicalElementMapping
{
    typedef FdoPhysicalElementMapping BaseType;
    friend class FdoWcsOvClassDefinition;

public:
    /// \brief
    /// Constructs a new Raster Definition.
    /// 
    /// \return
    /// Returns the newly created FdoWcsOvRasterDefinition instance.
    /// 
    FDOWCS_API static FdoWcsOvRasterDefinition* Create();

    /// \brief
    /// Gets the spatial context in which the requested 
    /// WCS map will be returned.
    /// 
    /// \remarks
    /// The same spatial context name applies to all coverages 
    /// in a single WCS class definition.
    /// 
    /// \return
    /// Returns the WCS Provider's spatial context name.
    /// 
    FDOWCS_API FdoString* GetSpatialContextName(void) const;

    /// \brief
    /// Sets the spatial context in which the requested 
    /// WCS map will be returned.
    /// 
    /// \remarks
    /// The same spatial context name applies to all layers 
    /// in a single WCS class definition.
    /// 
    /// \return
    /// Returns nothing.
    /// 
    FDOWCS_API void SetSpatialContextName(FdoString* value);

    /// \brief
    /// Gets the WCS layers that will be used to construct 
    /// the composite WCS image.
    /// 
    /// \remarks
    /// A WCS shall render the requested layers by drawing 
    /// the first map in the list bottommost, the next one over that, 
    /// and so on.
    /// 
    /// \return
    /// Returns the collection of WCS layers associated to the logical 
    /// FDO class definition.
    /// 
    FDOWCS_API FdoWcsOvCoverageCollection* GetCoverages(void) const;

    /// \brief
    /// Gets the fully qualified name of this element
    /// 
    /// \return
    /// Returns the qualified element name
    /// 
    FDOWCS_API virtual FdoStringP GetQualifiedName();

/// \cond DOXYGEN-IGNORE

    /// XML Serialization functions, not part of supported API.
    FDOWCS_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
    FDOWCS_API virtual FdoXmlSaxHandler* XmlStartElement(
        FdoXmlSaxContext* context, 
        FdoString* uri, 
        FdoString* name, 
        FdoString* qname, 
        FdoXmlAttributeCollection* atts
    );
    FDOWCS_API virtual FdoBoolean XmlEndElement(FdoXmlSaxContext* context, FdoString* uri, FdoString* name, FdoString* qname);
    FDOWCS_API void _writeXml( FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags );

protected:
    FDOWCS_API FdoWcsOvRasterDefinition(void);
    FDOWCS_API virtual ~FdoWcsOvRasterDefinition(void);

protected:
    void Dispose(void);

private:
    FdoStringP m_spatialContext;
    FdoWcsOvCoveragesP m_coverages;
    FdoXmlCharDataHandler *m_pXmlContentHandler;

/// \endcond

};

/// \brief
///  FdoWcsOvRasterDefinitionP is a FdoPtr on FdoWcsOvRasterDefinition, provided for convenience. 
typedef FdoPtr<FdoWcsOvRasterDefinition> FdoWcsOvRasterDefinitionP;

#endif  // FDOWCSRASTERDEFINITION_H


